package com.zlm.amqp.service;

import com.zlm.amqp.conf.RabbitConfig;
import com.zlm.common.enums.SystemCode;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * rabbit生产者
 * @Author: duyufu
 * @Date: 2019/7/5 13:49
 */
@Service
public class SenderImpl implements Sender {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    @Override
    public void hxRegisterSend(String context,String queueName) {
        System.out.println("Sender : " + context);
        new Queue(queueName);
        this.rabbitTemplate.convertAndSend(queueName, context);
    }


}
